This page last changed on Apr 16, 2009 by pwy4104.

 Checkout

Checkout from our modifications source CVS repository:

  • Protocol: pserver
  • Username: xerox
  • Password: guest
  • Host: linus.se.rit.edu
  • Path: /home/senior-projects/sqlwikiplug/cvswell

 Settings [Partly obsolete]

The first issue is getting maven looking at right repositories for dependencies and maven plugins. The project POM has all the repositories needed to find available dependencies. There are some that must manually be installed, however. The settings file for maven allows you to specify a server to deploy to which is useful during development. If you've already build atlassian plugins, chances are you can skip this part. If not, the following settings.xml file should get you started. It goes in your .m2 folder (e.g. /home/eugene/.m2/ or C:\Documents and Settings\Eugene\.m2)

settings.xml:

<settings>
	<profiles>
		<profile>
			<id>profile</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>

			<properties>
				<atlassian.pdk.server.url>http://localhost:1990/confluence/</atlassian.pdk.server.url>
				<atlassian.pdk.server.username>admin</atlassian.pdk.server.username>
				<atlassian.pdk.server.password>admin</atlassian.pdk.server.password>
			</properties>
		</profile>
	</profiles>
</settings>

Build

After putting the settings in place, try a build. The first try will attempt to pull all of the dependencies and more than likely fail after a while. To start the build, run the following command from the sql-plugin
directory:

 mvn -e install

 Note: The dependencies are pretty heavy. Theres a good 70mb at least. The confluence-webapp jar is 50mb itself.

The build will probably fail on java activation framework and oracle's jdbc driver dependencies. You need to manually install all of these dependencies into maven. See belowfor more info. You may also run into HTTPS issues. A solution to this is described below.

JTA [May be obsolete]

Go to: http://download.java.net/maven/2/javax/transaction/jta/1.0.1B/

Download jta-1.0.1B.jar run:

mvn install:install-file -Dfile=./jta-1.0.1B.jar -DgroupId=javax.transaction -DartifactId=jta -Dversion=1.0.1B -Dpackaging=jar -DgeneratePom=true

Java Activation (JAF) 1.0.2

Go to: http://java.sun.com/products/javabeans/glasgow/jaf.html

Download jaf-1_0_2-upd2.zip, unzip it, and run:

mvn install:install-file -DgroupId=javax.activation -DartifactId=activation -Dversion=1.0.2 -Dpackaging=jar -Dfile=activation.jar -DgeneratePom=true

Javamail [May be obsolete]

Go to: http://java.sun.com/products/javamail/downloads/index.html, or http://java.sun.com/products/javamail/javamail-1_3_3.html

Download version 1.3.3: javamail-1_3_3_01.zip, unzip it, and run:

mvn install:install-file -DgroupId=javax.mail -DartifactId=mail -Dversion=1.3.3 -Dpackaging=jar -Dfile=mail.jar -DgeneratePom=true

MySQL and Oracle JDBC Drivers

Both the oracle and mysql jdbc drivers are required for the project to build in maven. They are not used in the source code for the main project jar, only during the testing phase. MySQL's driver is available in repositories. Oracle's is not. You should download the latest oracle 11g driver for your version of java (at the moment it is ojdbc5.jar or ojdbc6.jar version 11.1.0.7.0) available here:

http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc101040.html

Download and run:

mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc -Dversion=11.1.0.7.0 -Dpackaging=jar -Dfile=ojdbc6.jar -DgeneratePom=true

HTTPS/SSL Issues [May be obsolete]

If you get issues saying things about SSL or HTTPS, you have to tell maven that you trust the certificates. It doesn't provide a user interface for this so you will get an exception if you run with the -e option, usually it looks like:

Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

What you need to do is get the certificate from atlassian (assuming it is failing on the atlassian repository), import it into a Java key store, then tell maven to use that key store. To get the certificate, visit

https://svn.atlassian.com/svn/public/atlassian/pom/atlassian-contrib-pom/tags/atlassian-contrib-pom-9/ or some other page on that server. Then using the Cert Viewer extension for firefox, view page info (in the tools menu), go to the security view, choose export, and save.

Next setup a keystore. Probably best to do this in your .m2 directory. For reference visit: http://maven.apache.org/guides/mini/guide-repository-ssl.html. The general approach is to run:

keytool -v -alias mavenrepos -import -file /home/eugene/atlassian.com -keystore trust.jks

 Where the file after -file is the certificate you exported in firefox. Keytool will ask you for a password and to confirm the insert of the certificate. If you need to add more than one certificate you can keep running the command with different files.

 After setting up the keystore you need to tell maven how to find the keystore. In your home directory make a file called .mavenrc with contents like this:

MAVEN_OPTS="-Xmx512m -Djavax.net.ssl.trustStore=/home/eugene/.m2/trust.jks  \
                     -Djavax.net.ssl.trustStorePassword=PASSWORD HERE"

Where PASSWORD HERE is the password you gave to the keystore. Since this is plain text you should probably not choose one of your good passwords.

Try the build again, see what happens.

Using Eclipse

Check out project

Project -> Properties -> Java Build Path, click jre, edit, choose workspace default

Make sure its JDK, not jre.

Document generated by Confluence on May 21, 2009 10:23